#include "library.h"
#include <iostream>
#include <fstream>
#include <sstream>
int main() {
    Library lib;

    // 添加书籍
    Book b1 = {"C++ Primer", "Lippman", "1234567890", 5};
    Book b2 = {"Effective Modern C++", "Scott Meyers", "0987654321", 3};
    Book b3 = {"The C++ Programming Language", "Bjarne Stroustrup", "1122334455", 2};

    lib.addBook(b1);
    lib.addBook(b2);
    lib.addBook(b3);

    std::cout << "\n=== 当前所有书籍 ===\n";
    lib.showAllBooks();

    std::cout << "\n=== 查找书籍 'C++' ===\n";
    lib.searchBook("C++");

    std::cout << "\n=== 删除书籍 'Effective Modern C++' ===\n";
    lib.deleteBook("Effective Modern C++");

    std::cout << "\n=== 删除不存在的书籍 'Unknown Book' ===\n";
    lib.deleteBook("Unknown Book");

    std::cout << "\n=== 删除后的书籍列表 ===\n";
    lib.showAllBooks();

    return 0;
}
